Page({
  data: {
    navHeight:'',
    bgHeight:'',
	imgHead:'https://rhi0.xiyun.net/zhuandian/image/',
  userId:'',
  },
  onLoad() {
     my.getSystemInfo({
      success: (res) => {
        this.setData({
          'navHeight': res.statusBarHeight + res.titleBarHeight, //导航栏高度 
           'bgHeight': res.statusBarHeight + res.titleBarHeight + 220//背景图片高度
        })
      }
    });
    if(my.getStorageSync({key:'userInfo'}).data.id){
      let id = my.getStorageSync({key:'userInfo'}).data.id;
      this.setData({
        userId:id,
      })
    }
  },
  onShareAppMessage () {
    return {
      title: '挣点', // 标题
      desc: '任务多多，天天领取现金红包', // 描述
      path: 'pages/index/index?userid='+this.data.userId, // 分享的小程序页面
      success(res){
        my.navigateTo({
          url: '/pages/shareSuccess/shareSuccess'
        }); 
      },
      fail(res){
        console.log('fail',res)
      },
    }
  },
});
